home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / lst / lstFind.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-19  |  1.1 KB  |  45 lines

  1. /*-
  2.  * LstFind.c --
  3.  *    Find a node on a list.
  4.  *
  5.  * Copyright (c) 1988 by University of California Regents
  6.  *
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appears in all copies.  Neither the University of California nor
  11.  * Adam de Boor makes any representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15. #ifndef lint
  16. static char *rcsid =
  17. "$Id: lstFind.c,v 1.4 88/11/17 20:52:34 adam Exp $ SPRITE (Berkeley)";
  18. #endif lint
  19.  
  20. #include    "lstInt.h"
  21.  
  22. /*-
  23.  *-----------------------------------------------------------------------
  24.  * Lst_Find --
  25.  *    Find a node on the given list using the given comparison function
  26.  *    and the given datum.
  27.  *
  28.  * Results:
  29.  *    The found node or NILLNODE if none matches.
  30.  *
  31.  * Side Effects:
  32.  *    None.
  33.  *
  34.  *-----------------------------------------------------------------------
  35.  */
  36. LstNode
  37. Lst_Find (l, d, cProc)
  38.     Lst        l;
  39.     ClientData    d;
  40.     int        (*cProc)();
  41. {
  42.     return (Lst_FindFrom (l, Lst_First(l), d, cProc));
  43. }
  44.  
  45.